from dotenv import load_dotenv,find_dotenv
from langchain.prompts import PromptTemplate
from langchain_openai import ChatOpenAI

_ = load_dotenv(find_dotenv())

template = PromptTemplate.from_file("example_prompt_template.txt", encoding="utf8")

print(template)

prompt = template.format(topic="langchain")

llm = ChatOpenAI(model="gpt-4o")
response = llm.invoke(prompt)
print(response.content)